Test Series - Data Structure

Test Number 95/115

Q: What is a time complexity for finding all the maximal palindrome in a string?
A. Ɵ (n)
B. Ɵ (n!)
C. Ɵ (1)
D. O (log n!)
Solution: Palindrome is a string that is the same when reading forward as well as backward. To check if a substring is present in a string of a length of n, the time complexity for such operation is found to be O (n). The time complexity for finding all the maximal palindrome in a string is Ɵ (n).
Q: What is a time complexity for finding all the tandem repeats?
A. Ɵ (n)
B. Ɵ (n!)
C. Ɵ (1)
D. O (n log n + z)
Solution: Tandem Repeats are formed in DNA when the nucleotides pattern repeats more than once. To check if a substring is present in a string of a length of n, the time complexity for such operation is found to be O (n). The time complexity for finding all the tandem repeats in a string is O (n log n + z).
Q: What is a time complexity for finding the longest palindromic substring in a string by using the generalized suffix tree?
A. Linear Time
B. Exponential Time
C. Logarithmic Time
D. Cubic Time
Solution: Palindrome is a string that is same when reading forward as well as backward. The time complexity for finding the longest palindromic substring in a string by using generalized suffix tree is linear time.
Q: Which of the following algorithm of data compression uses a suffix tree?
A. Weiner’s algorithm
B. Farach’s algorithm
C. Lempel – Ziv – Welch’s algorithm
D. Alexander Morse’s algorithm
Solution: The concept of Suffix Tree was introduced by Weiner in 1973. Ukkonen provided the first online contribution of the Suffix tree. Farach gave the first suffix tree contribution for all alphabets in 1997. Lempel – Ziv – Welch’s algorithm of data compression uses a suffix tree.
Q: Which of the following data clustering algorithm uses suffix tree in search engines?
A. Weiner’s algorithm
B. Farach’s algorithm
C. Lempel – Ziv – Welch’s algorithm
D. Suffix Tree Clustering
Solution: The concept of Suffix Tree was introduced by Weiner in 1973. Ukkonen provided the first online contribution of Suffix. Farach gave the first suffix tree contribution for all alphabets in 1997. Suffix Tree Clustering is a data clustering algorithm that uses suffix tree in search engines.
Q: What is a time complexity for finding the total length of all string on all edges of a tree?
A. Ɵ (n)
B. Ɵ (n!)
C. Ɵ (1)
D. O (n2)
Solution: To check if a substring is present in a string of a length of n, the time complexity for such operation is found to be O (n). The time complexity for finding the total length of all string on all edges of a tree is O (n2).
Q: Can suffix tree be used in string problems occurring in a text editor.
A. True
B. False
C. ....
D. ....
Solution: It is a compressed search tree or prefix tree in which keys contain the suffix of text values as the text position. So, the suffix tree can be used in string problems occurring in a text editor. The time taken to solve the problem is linear to the length of the string.
Q: Can suffix tree be used in bioinformatics problems and solutions.
A. True
B. False
C. ....
D. ....
Solution: It is a compressed search tree or prefix tree in which keys contain the suffix of text values as the text position. So, a suffix tree is used in bioinformatics problems and solutions like pattern searching in DNA and protein sequences.
Q: For what size of nodes, the worst case of usage of space in suffix tree seen?
A. n Nodes
B. 2n Nodes
C. 2n nodes
D. n! nodes
Solution: In computer science, the worst case of usage of space in a suffix tree is found to be for a Fibonacci word for a full 2n nodes. The time complexity for usage of space is found to be O (n).
Q: What is a time complexity for inserting an alphabet in the tree using hash maps?
A. O (log n!)
B. O (n!)
C. O (n2)
D. O (1)
Solution: Suffix tree is also known as PAT tree or position tree. It allows fast string operation. Total time taken for construction of suffix tree is linear to the length of the tree. The time complexity for inserting an alphabet in the tree using hash maps is constant, O (1).

You Have Score    /10